package com.hzqy.web.login;

import java.util.Observable;

import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.hzqy.web.vo.EpgInfoVo;

/**
 * 解析epg_info
 * @author dead
 *
 */
public class EpgInfoParse extends Observable {
	private static final Log LOG = LogFactory.getLog(EpgInfoParse.class);
	
	public void loginParse(HttpSession session,String epg_info) throws Exception {
		EpgInfoVo epgInfoVo = new EpgInfoVo();
		String epg_info_root ="<root>"+epg_info+"</root>";
		try {
			XmlUtils.writeObject(epgInfoVo, epg_info_root,0);
			session.setAttribute(SessionKey.SESSION_EPG_INFO, epg_info);
			setChanged();
			notifyObservers(epgInfoVo);
		} catch(Exception e) {
			LOG.error("解析EPG_INFO错误:",e);
			throw e;
		}
	}
}
